package org.lds.message.center.email.consumer;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.lds.message.center.common.model.request.EmailRequest;
import org.lds.message.center.email.EmailMessageService;
import org.lds.message.center.plugin.core.kafka.MessageServiceKafkaConsumer;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.support.Acknowledgment;

import java.util.List;

public class EmailConsumer extends MessageServiceKafkaConsumer<EmailRequest> {

    public EmailConsumer(EmailMessageService emailMessageService) {
        super(emailMessageService, EmailRequest.class);
    }

    @Override
    @KafkaListener(topics = {"${message-center.email.topic}"}, groupId = "${message-center.email.group-id}")
    public void consume(List<ConsumerRecord<String, String>> records, Acknowledgment ack) {
        super.consume(records, ack);
    }

}
